import request from '@/utils/request'

// 查询工时列表
export function listWorklog(query) {
  return request({
    url: '/erp/worklog/list',
    method: 'get',
    params: query
  })
}

// 查询工时详细
export function getWorklog(id) {
  return request({
    url: '/erp/worklog/' + id,
    method: 'get'
  })
}

// 新增工时
export function addWorklog(data) {
  return request({
    url: '/erp/worklog',
    method: 'post',
    data: data
  })
}

// 修改工时
export function updateWorklog(data) {
  return request({
    url: '/erp/worklog',
    method: 'put',
    data: data
  })
}

// 删除工时
export function delWorklog(id) {
  return request({
    url: '/erp/worklog/' + id,
    method: 'delete'
  })
}

// 获取任务工时详情
export function getWorkLogInfo(taskId) {
  return request({
    url: '/oa/getWorkLogInfo',
    method: 'get',
    params: { taskId }
  })
}
